home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Technology Seed / August 1998 ADC Seed CD.toast / Mac OS 8.5b2 / allegro-b2-pseudo-SDK / AIncludes / Icons.a < prev    next >
Encoding:
Text File  |  1998-07-17  |  51.0 KB  |  1,861 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Icons.a
  3. ;
  4. ;    Contains:    Icon Utilities and Icon Services Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8
  7. ;                Release:    Allego Seed, Use with 3.1 Universal Interfaces
  8. ;
  9. ;    Copyright:    © 1990-1998 by Apple Computer, Inc. All rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__ICONS__') = 'UNDEFINED' THEN
  19. __ICONS__ SET 1
  20.  
  21.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  22.     include 'MacTypes.a'
  23.     ENDIF
  24.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  25.     include 'Quickdraw.a'
  26.     ENDIF
  27.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  28.     include 'Files.a'
  29.     ENDIF
  30.     IF &TYPE('__CODEFRAGMENTS__') = 'UNDEFINED' THEN
  31.     include 'CodeFragments.a'
  32.     ENDIF
  33.  
  34. ;  The following are icons for which there are both icon suites and SICNs. 
  35. ;  Avoid using icon resources if possible. Use IconServices instead. 
  36.  
  37. kGenericDocumentIconResource    EQU        -4000
  38. kGenericStationeryIconResource    EQU        -3985
  39. kGenericEditionFileIconResource    EQU        -3989
  40. kGenericApplicationIconResource    EQU        -3996
  41. kGenericDeskAccessoryIconResource EQU    -3991
  42. kGenericFolderIconResource        EQU        -3999
  43. kPrivateFolderIconResource        EQU        -3994
  44. kFloppyIconResource                EQU        -3998
  45. kTrashIconResource                EQU        -3993
  46. kGenericRAMDiskIconResource        EQU        -3988
  47. kGenericCDROMIconResource        EQU        -3987
  48. ;  The following are icons for which there are SICNs only. 
  49. ;  Avoid using icon resources if possible. Use IconServices instead. 
  50.  
  51. kDesktopIconResource            EQU        -3992
  52. kOpenFolderIconResource            EQU        -3997
  53. kGenericHardDiskIconResource    EQU        -3995
  54. kGenericFileServerIconResource    EQU        -3972
  55. kGenericSuitcaseIconResource    EQU        -3970
  56. kGenericMoverObjectIconResource    EQU        -3969
  57. ;  The following are icons for which there are icon suites only. 
  58. ;  Avoid using icon resources if possible. Use IconServices instead. 
  59.  
  60. kGenericPreferencesIconResource    EQU        -3971
  61. kGenericQueryDocumentIconResource EQU    -16506
  62. kGenericExtensionIconResource    EQU        -16415
  63. kSystemFolderIconResource        EQU        -3983
  64. kHelpIconResource                EQU        -20271
  65. kAppleMenuFolderIconResource    EQU        -3982
  66. ;  Obsolete. Use named constants defined above. 
  67.  
  68. genericDocumentIconResource        EQU        -4000
  69. genericStationeryIconResource    EQU        -3985
  70. genericEditionFileIconResource    EQU        -3989
  71. genericApplicationIconResource    EQU        -3996
  72. genericDeskAccessoryIconResource EQU    -3991
  73. genericFolderIconResource        EQU        -3999
  74. privateFolderIconResource        EQU        -3994
  75. floppyIconResource                EQU        -3998
  76. trashIconResource                EQU        -3993
  77. genericRAMDiskIconResource        EQU        -3988
  78. genericCDROMIconResource        EQU        -3987
  79. desktopIconResource                EQU        -3992
  80. openFolderIconResource            EQU        -3997
  81. genericHardDiskIconResource        EQU        -3995
  82. genericFileServerIconResource    EQU        -3972
  83. genericSuitcaseIconResource        EQU        -3970
  84. genericMoverObjectIconResource    EQU        -3969
  85. genericPreferencesIconResource    EQU        -3971
  86. genericQueryDocumentIconResource EQU    -16506
  87. genericExtensionIconResource    EQU        -16415
  88. systemFolderIconResource        EQU        -3983
  89. appleMenuFolderIconResource        EQU        -3982
  90. ;  Avoid using icon resources if possible. Use IconServices instead. 
  91.  
  92. kStartupFolderIconResource        EQU        -3981
  93. kOwnedFolderIconResource        EQU        -3980
  94. kDropFolderIconResource            EQU        -3979
  95. kSharedFolderIconResource        EQU        -3978
  96. kMountedFolderIconResource        EQU        -3977
  97. kControlPanelFolderIconResource    EQU        -3976
  98. kPrintMonitorFolderIconResource    EQU        -3975
  99. kPreferencesFolderIconResource    EQU        -3974
  100. kExtensionsFolderIconResource    EQU        -3973
  101. kFontsFolderIconResource        EQU        -3968
  102. kFullTrashIconResource            EQU        -3984
  103. ;  Obsolete. Use named constants defined above. 
  104.  
  105. startupFolderIconResource        EQU        -3981
  106. ownedFolderIconResource            EQU        -3980
  107. dropFolderIconResource            EQU        -3979
  108. sharedFolderIconResource        EQU        -3978
  109. mountedFolderIconResource        EQU        -3977
  110. controlPanelFolderIconResource    EQU        -3976
  111. printMonitorFolderIconResource    EQU        -3975
  112. preferencesFolderIconResource    EQU        -3974
  113. extensionsFolderIconResource    EQU        -3973
  114. fontsFolderIconResource            EQU        -3968
  115. fullTrashIconResource            EQU        -3984
  116.  
  117. kHuge1BitMask                    EQU        'ich#'
  118. kHuge4BitData                    EQU        'ich4'
  119. kHuge8BitData                    EQU        'ich8'
  120. kHuge32BitData                    EQU        'ih32'
  121. kHuge8BitMask                    EQU        'h8mk'
  122. kLarge1BitMask                    EQU        'ICN#'
  123. kLarge4BitData                    EQU        'icl4'
  124. kLarge8BitData                    EQU        'icl8'
  125. kLarge32BitData                    EQU        'il32'
  126. kLarge8BitMask                    EQU        'l8mk'
  127. kSmall1BitMask                    EQU        'ics#'
  128. kSmall4BitData                    EQU        'ics4'
  129. kSmall8BitData                    EQU        'ics8'
  130. kSmall32BitData                    EQU        'is32'
  131. kSmall8BitMask                    EQU        's8mk'
  132. kMini1BitMask                    EQU        'icm#'
  133. kMini4BitData                    EQU        'icm4'
  134. kMini8BitData                    EQU        'icm8'
  135. ;  Obsolete. Use names defined above. 
  136.  
  137. large1BitMask                    EQU        'ICN#'
  138. large4BitData                    EQU        'icl4'
  139. large8BitData                    EQU        'icl8'
  140. small1BitMask                    EQU        'ics#'
  141. small4BitData                    EQU        'ics4'
  142. small8BitData                    EQU        'ics8'
  143. mini1BitMask                    EQU        'icm#'
  144. mini4BitData                    EQU        'icm4'
  145. mini8BitData                    EQU        'icm8'
  146. ;  Alignment type values. 
  147.  
  148. kAlignNone                        EQU        $00
  149. kAlignVerticalCenter            EQU        $01
  150. kAlignTop                        EQU        $02
  151. kAlignBottom                    EQU        $03
  152. kAlignHorizontalCenter            EQU        $04
  153. kAlignAbsoluteCenter            EQU        $05
  154. kAlignCenterTop                    EQU        $06
  155. kAlignCenterBottom                EQU        $07
  156. kAlignLeft                        EQU        $08
  157. kAlignCenterLeft                EQU        $09
  158. kAlignTopLeft                    EQU        $0A
  159. kAlignBottomLeft                EQU        $0B
  160. kAlignRight                        EQU        $0C
  161. kAlignCenterRight                EQU        $0D
  162. kAlignTopRight                    EQU        $0E
  163. kAlignBottomRight                EQU        $0F
  164. ;  Obsolete. Use names defined above. 
  165.  
  166. atNone                            EQU        $00
  167. atVerticalCenter                EQU        $01
  168. atTop                            EQU        $02
  169. atBottom                        EQU        $03
  170. atHorizontalCenter                EQU        $04
  171. atAbsoluteCenter                EQU        $05
  172. atCenterTop                        EQU        $06
  173. atCenterBottom                    EQU        $07
  174. atLeft                            EQU        $08
  175. atCenterLeft                    EQU        $09
  176. atTopLeft                        EQU        $0A
  177. atBottomLeft                    EQU        $0B
  178. atRight                            EQU        $0C
  179. atCenterRight                    EQU        $0D
  180. atTopRight                        EQU        $0E
  181. atBottomRight                    EQU        $0F
  182. ; typedef SInt16                         IconAlignmentType
  183.  
  184. ;  Transform type values. 
  185.  
  186. kTransformNone                    EQU        $00
  187. kTransformDisabled                EQU        $01
  188. kTransformOffline                EQU        $02
  189. kTransformOpen                    EQU        $03
  190. kTransformLabel1                EQU        $0100
  191. kTransformLabel2                EQU        $0200
  192. kTransformLabel3                EQU        $0300
  193. kTransformLabel4                EQU        $0400
  194. kTransformLabel5                EQU        $0500
  195. kTransformLabel6                EQU        $0600
  196. kTransformLabel7                EQU        $0700
  197. kTransformSelected                EQU        $4000
  198. kTransformSelectedDisabled        EQU        $4001
  199. kTransformSelectedOffline        EQU        $4002
  200. kTransformSelectedOpen            EQU        $4003
  201. ;  Obsolete. Use names defined above. 
  202.  
  203. ttNone                            EQU        $00
  204. ttDisabled                        EQU        $01
  205. ttOffline                        EQU        $02
  206. ttOpen                            EQU        $03
  207. ttLabel1                        EQU        $0100
  208. ttLabel2                        EQU        $0200
  209. ttLabel3                        EQU        $0300
  210. ttLabel4                        EQU        $0400
  211. ttLabel5                        EQU        $0500
  212. ttLabel6                        EQU        $0600
  213. ttLabel7                        EQU        $0700
  214. ttSelected                        EQU        $4000
  215. ttSelectedDisabled                EQU        $4001
  216. ttSelectedOffline                EQU        $4002
  217. ttSelectedOpen                    EQU        $4003
  218. ; typedef SInt16                         IconTransformType
  219.  
  220. ;  Selector mask values. 
  221.  
  222. kSelectorLarge1Bit                EQU        $00000001
  223. kSelectorLarge4Bit                EQU        $00000002
  224. kSelectorLarge8Bit                EQU        $00000004
  225. kSelectorLarge32Bit                EQU        $00000008
  226. kSelectorLarge8BitMask            EQU        $00000010
  227. kSelectorSmall1Bit                EQU        $00000100
  228. kSelectorSmall4Bit                EQU        $00000200
  229. kSelectorSmall8Bit                EQU        $00000400
  230. kSelectorSmall32Bit                EQU        $00000800
  231. kSelectorSmall8BitMask            EQU        $00001000
  232. kSelectorMini1Bit                EQU        $00010000
  233. kSelectorMini4Bit                EQU        $00020000
  234. kSelectorMini8Bit                EQU        $00040000
  235. kSelectorHuge1Bit                EQU        $01000000
  236. kSelectorHuge4Bit                EQU        $02000000
  237. kSelectorHuge8Bit                EQU        $04000000
  238. kSelectorHuge32Bit                EQU        $08000000
  239. kSelectorHuge8BitMask            EQU        $10000000
  240. kSelectorAllLargeData            EQU        $000000FF
  241. kSelectorAllSmallData            EQU        $0000FF00
  242. kSelectorAllMiniData            EQU        $00FF0000
  243. kSelectorAllHugeData            EQU        $FF000000
  244. kSelectorAll1BitData            EQU        $01010101
  245. kSelectorAll4BitData            EQU        $02020202
  246. kSelectorAll8BitData            EQU        $04040404
  247. kSelectorAll32BitData            EQU        $08000808
  248. kSelectorAllAvailableData        EQU        $FFFFFFFF
  249.  
  250. ;  Obsolete. Use names defined above. 
  251.  
  252. svLarge1Bit                        EQU        $00000001
  253. svLarge4Bit                        EQU        $00000002
  254. svLarge8Bit                        EQU        $00000004
  255. svSmall1Bit                        EQU        $00000100
  256. svSmall4Bit                        EQU        $00000200
  257. svSmall8Bit                        EQU        $00000400
  258. svMini1Bit                        EQU        $00010000
  259. svMini4Bit                        EQU        $00020000
  260. svMini8Bit                        EQU        $00040000
  261. svAllLargeData                    EQU        $000000FF
  262. svAllSmallData                    EQU        $0000FF00
  263. svAllMiniData                    EQU        $00FF0000
  264. svAll1BitData                    EQU        $01010101
  265. svAll4BitData                    EQU        $02020202
  266. svAll8BitData                    EQU        $04040404
  267. svAllAvailableData                EQU        $FFFFFFFF
  268. ; typedef UInt32                         IconSelectorValue
  269.  
  270. ; typedef IconActionProcPtr             IconAction
  271.  
  272. ; typedef IconGetterProcPtr             IconGetter
  273.  
  274.     IF ¬ OLDROUTINELOCATIONS THEN
  275. CIcon                    RECORD 0
  276. iconPMap                 ds        PixMap            ; offset: $0 (0)        ; the icon's pixMap
  277. iconMask                 ds        BitMap            ; offset: $32 (50)        ; the icon's mask
  278. iconBMap                 ds        BitMap            ; offset: $40 (64)        ; the icon's bitMap
  279. iconData                 ds.l    1                ; offset: $4E (78)        ; the icon's data
  280. iconMaskData             ds.w    1                ; offset: $52 (82) <-- really an array of length one ; icon's mask and BitMap data
  281. sizeof                     EQU *                    ; size:   $54 (84)
  282.                         ENDR
  283. ; typedef struct CIcon *                CIconPtr
  284.  
  285. ; typedef CIconPtr *                    CIconHandle
  286.  
  287. ;
  288. ; pascal CIconHandle GetCIcon(SInt16 iconID)
  289. ;
  290.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  291.         _GetCIcon:    OPWORD    $AA1E
  292.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  293.         IMPORT_CFM_FUNCTION GetCIcon
  294.     ENDIF
  295.  
  296. ;
  297. ; pascal void PlotCIcon(const Rect *theRect, CIconHandle theIcon)
  298. ;
  299.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  300.         _PlotCIcon:    OPWORD    $AA1F
  301.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  302.         IMPORT_CFM_FUNCTION PlotCIcon
  303.     ENDIF
  304.  
  305. ;
  306. ; pascal void DisposeCIcon(CIconHandle theIcon)
  307. ;
  308.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  309.         _DisposeCIcon:    OPWORD    $AA25
  310.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  311.         IMPORT_CFM_FUNCTION DisposeCIcon
  312.     ENDIF
  313.  
  314.     ENDIF
  315. ;
  316. ; pascal Handle GetIcon(SInt16 iconID)
  317. ;
  318.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  319.         _GetIcon:    OPWORD    $A9BB
  320.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  321.         IMPORT_CFM_FUNCTION GetIcon
  322.     ENDIF
  323.  
  324. ;
  325. ; pascal void PlotIcon(const Rect *theRect, Handle theIcon)
  326. ;
  327.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  328.         _PlotIcon:    OPWORD    $A94B
  329.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  330.         IMPORT_CFM_FUNCTION PlotIcon
  331.     ENDIF
  332.  
  333.  
  334.  
  335. ;    Note:    IconSuiteRef and IconCacheRef should be an abstract types, 
  336. ;            but too much source code already relies on them being of type Handle.
  337. ;
  338.  
  339. ; typedef Handle                         IconSuiteRef
  340.  
  341. ; typedef Handle                         IconCacheRef
  342.  
  343. ;  IconRefs are 32-bit values identifying cached icon data. IconRef 0 is invalid.
  344.  
  345.  
  346. ;
  347. ; pascal OSErr PlotIconID(const Rect *theRect, IconAlignmentType align, IconTransformType transform, SInt16 theResID)
  348. ;
  349.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  350.         Macro
  351.         _PlotIconID
  352.             move.w              #$0500,D0
  353.             dc.w                $ABC9
  354.         EndM
  355.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  356.         IMPORT_CFM_FUNCTION PlotIconID
  357.     ENDIF
  358.  
  359. ;
  360. ; pascal OSErr NewIconSuite(IconSuiteRef *theIconSuite)
  361. ;
  362.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  363.         Macro
  364.         _NewIconSuite
  365.             move.w              #$0207,D0
  366.             dc.w                $ABC9
  367.         EndM
  368.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  369.         IMPORT_CFM_FUNCTION NewIconSuite
  370.     ENDIF
  371.  
  372. ;
  373. ; pascal OSErr AddIconToSuite(Handle theIconData, IconSuiteRef theSuite, ResType theType)
  374. ;
  375.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  376.         Macro
  377.         _AddIconToSuite
  378.             move.w              #$0608,D0
  379.             dc.w                $ABC9
  380.         EndM
  381.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  382.         IMPORT_CFM_FUNCTION AddIconToSuite
  383.     ENDIF
  384.  
  385. ;
  386. ; pascal OSErr GetIconFromSuite(Handle *theIconData, IconSuiteRef theSuite, ResType theType)
  387. ;
  388.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  389.         Macro
  390.         _GetIconFromSuite
  391.             move.w              #$0609,D0
  392.             dc.w                $ABC9
  393.         EndM
  394.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  395.         IMPORT_CFM_FUNCTION GetIconFromSuite
  396.     ENDIF
  397.  
  398. ;
  399. ; pascal OSErr ForEachIconDo(IconSuiteRef theSuite, IconSelectorValue selector, IconActionUPP action, void *yourDataPtr)
  400. ;
  401.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  402.         Macro
  403.         _ForEachIconDo
  404.             move.w              #$080A,D0
  405.             dc.w                $ABC9
  406.         EndM
  407.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  408.         IMPORT_CFM_FUNCTION ForEachIconDo
  409.     ENDIF
  410.  
  411. ;
  412. ; pascal OSErr GetIconSuite(IconSuiteRef *theIconSuite, SInt16 theResID, IconSelectorValue selector)
  413. ;
  414.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  415.         Macro
  416.         _GetIconSuite
  417.             move.w              #$0501,D0
  418.             dc.w                $ABC9
  419.         EndM
  420.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  421.         IMPORT_CFM_FUNCTION GetIconSuite
  422.     ENDIF
  423.  
  424. ;
  425. ; pascal OSErr DisposeIconSuite(IconSuiteRef theIconSuite, Boolean disposeData)
  426. ;
  427.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  428.         Macro
  429.         _DisposeIconSuite
  430.             move.w              #$0302,D0
  431.             dc.w                $ABC9
  432.         EndM
  433.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  434.         IMPORT_CFM_FUNCTION DisposeIconSuite
  435.     ENDIF
  436.  
  437. ;
  438. ; pascal OSErr PlotIconSuite(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconSuiteRef theIconSuite)
  439. ;
  440.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  441.         Macro
  442.         _PlotIconSuite
  443.             move.w              #$0603,D0
  444.             dc.w                $ABC9
  445.         EndM
  446.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  447.         IMPORT_CFM_FUNCTION PlotIconSuite
  448.     ENDIF
  449.  
  450. ;
  451. ; pascal OSErr MakeIconCache(IconCacheRef *theCache, IconGetterUPP makeIcon, void *yourDataPtr)
  452. ;
  453.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  454.         Macro
  455.         _MakeIconCache
  456.             move.w              #$0604,D0
  457.             dc.w                $ABC9
  458.         EndM
  459.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  460.         IMPORT_CFM_FUNCTION MakeIconCache
  461.     ENDIF
  462.  
  463. ;
  464. ; pascal OSErr LoadIconCache(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconCacheRef theIconCache)
  465. ;
  466.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  467.         Macro
  468.         _LoadIconCache
  469.             move.w              #$0606,D0
  470.             dc.w                $ABC9
  471.         EndM
  472.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  473.         IMPORT_CFM_FUNCTION LoadIconCache
  474.     ENDIF
  475.  
  476. ;
  477. ; pascal OSErr PlotIconMethod(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconGetterUPP theMethod, void *yourDataPtr)
  478. ;
  479.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  480.         Macro
  481.         _PlotIconMethod
  482.             move.w              #$0805,D0
  483.             dc.w                $ABC9
  484.         EndM
  485.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  486.         IMPORT_CFM_FUNCTION PlotIconMethod
  487.     ENDIF
  488.  
  489. ;
  490. ; pascal OSErr GetLabel(SInt16 labelNumber, RGBColor *labelColor, Str255 labelString)
  491. ;
  492.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  493.         Macro
  494.         _GetLabel
  495.             move.w              #$050B,D0
  496.             dc.w                $ABC9
  497.         EndM
  498.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  499.         IMPORT_CFM_FUNCTION GetLabel
  500.     ENDIF
  501.  
  502. ;
  503. ; pascal Boolean PtInIconID(Point testPt, const Rect *iconRect, IconAlignmentType align, SInt16 iconID)
  504. ;
  505.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  506.         Macro
  507.         _PtInIconID
  508.             move.w              #$060D,D0
  509.             dc.w                $ABC9
  510.         EndM
  511.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  512.         IMPORT_CFM_FUNCTION PtInIconID
  513.     ENDIF
  514.  
  515. ;
  516. ; pascal Boolean PtInIconSuite(Point testPt, const Rect *iconRect, IconAlignmentType align, IconSuiteRef theIconSuite)
  517. ;
  518.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  519.         Macro
  520.         _PtInIconSuite
  521.             move.w              #$070E,D0
  522.             dc.w                $ABC9
  523.         EndM
  524.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  525.         IMPORT_CFM_FUNCTION PtInIconSuite
  526.     ENDIF
  527.  
  528. ;
  529. ; pascal Boolean PtInIconMethod(Point testPt, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
  530. ;
  531.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  532.         Macro
  533.         _PtInIconMethod
  534.             move.w              #$090F,D0
  535.             dc.w                $ABC9
  536.         EndM
  537.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  538.         IMPORT_CFM_FUNCTION PtInIconMethod
  539.     ENDIF
  540.  
  541. ;
  542. ; pascal Boolean RectInIconID(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, SInt16 iconID)
  543. ;
  544.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  545.         Macro
  546.         _RectInIconID
  547.             move.w              #$0610,D0
  548.             dc.w                $ABC9
  549.         EndM
  550.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  551.         IMPORT_CFM_FUNCTION RectInIconID
  552.     ENDIF
  553.  
  554. ;
  555. ; pascal Boolean RectInIconSuite(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, IconSuiteRef theIconSuite)
  556. ;
  557.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  558.         Macro
  559.         _RectInIconSuite
  560.             move.w              #$0711,D0
  561.             dc.w                $ABC9
  562.         EndM
  563.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  564.         IMPORT_CFM_FUNCTION RectInIconSuite
  565.     ENDIF
  566.  
  567. ;
  568. ; pascal Boolean RectInIconMethod(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
  569. ;
  570.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  571.         Macro
  572.         _RectInIconMethod
  573.             move.w              #$0912,D0
  574.             dc.w                $ABC9
  575.         EndM
  576.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  577.         IMPORT_CFM_FUNCTION RectInIconMethod
  578.     ENDIF
  579.  
  580. ;
  581. ; pascal OSErr IconIDToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, SInt16 iconID)
  582. ;
  583.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  584.         Macro
  585.         _IconIDToRgn
  586.             move.w              #$0613,D0
  587.             dc.w                $ABC9
  588.         EndM
  589.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  590.         IMPORT_CFM_FUNCTION IconIDToRgn
  591.     ENDIF
  592.  
  593. ;
  594. ; pascal OSErr IconSuiteToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, IconSuiteRef theIconSuite)
  595. ;
  596.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  597.         Macro
  598.         _IconSuiteToRgn
  599.             move.w              #$0714,D0
  600.             dc.w                $ABC9
  601.         EndM
  602.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  603.         IMPORT_CFM_FUNCTION IconSuiteToRgn
  604.     ENDIF
  605.  
  606. ;
  607. ; pascal OSErr IconMethodToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, IconGetterUPP theMethod, void *yourDataPtr)
  608. ;
  609.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  610.         Macro
  611.         _IconMethodToRgn
  612.             move.w              #$0915,D0
  613.             dc.w                $ABC9
  614.         EndM
  615.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  616.         IMPORT_CFM_FUNCTION IconMethodToRgn
  617.     ENDIF
  618.  
  619. ;
  620. ; pascal OSErr SetSuiteLabel(IconSuiteRef theSuite, SInt16 theLabel)
  621. ;
  622.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  623.         Macro
  624.         _SetSuiteLabel
  625.             move.w              #$0316,D0
  626.             dc.w                $ABC9
  627.         EndM
  628.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  629.         IMPORT_CFM_FUNCTION SetSuiteLabel
  630.     ENDIF
  631.  
  632. ;
  633. ; pascal SInt16 GetSuiteLabel(IconSuiteRef theSuite)
  634. ;
  635.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  636.         Macro
  637.         _GetSuiteLabel
  638.             move.w              #$0217,D0
  639.             dc.w                $ABC9
  640.         EndM
  641.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  642.         IMPORT_CFM_FUNCTION GetSuiteLabel
  643.     ENDIF
  644.  
  645. ;
  646. ; pascal OSErr GetIconCacheData(IconCacheRef theCache, void **theData)
  647. ;
  648.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  649.         Macro
  650.         _GetIconCacheData
  651.             move.w              #$0419,D0
  652.             dc.w                $ABC9
  653.         EndM
  654.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  655.         IMPORT_CFM_FUNCTION GetIconCacheData
  656.     ENDIF
  657.  
  658. ;
  659. ; pascal OSErr SetIconCacheData(IconCacheRef theCache, void *theData)
  660. ;
  661.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  662.         Macro
  663.         _SetIconCacheData
  664.             move.w              #$041A,D0
  665.             dc.w                $ABC9
  666.         EndM
  667.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  668.         IMPORT_CFM_FUNCTION SetIconCacheData
  669.     ENDIF
  670.  
  671. ;
  672. ; pascal OSErr GetIconCacheProc(IconCacheRef theCache, IconGetterUPP *theProc)
  673. ;
  674.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  675.         Macro
  676.         _GetIconCacheProc
  677.             move.w              #$041B,D0
  678.             dc.w                $ABC9
  679.         EndM
  680.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  681.         IMPORT_CFM_FUNCTION GetIconCacheProc
  682.     ENDIF
  683.  
  684. ;
  685. ; pascal OSErr SetIconCacheProc(IconCacheRef theCache, IconGetterUPP theProc)
  686. ;
  687.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  688.         Macro
  689.         _SetIconCacheProc
  690.             move.w              #$041C,D0
  691.             dc.w                $ABC9
  692.         EndM
  693.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  694.         IMPORT_CFM_FUNCTION SetIconCacheProc
  695.     ENDIF
  696.  
  697. ;
  698. ; pascal OSErr PlotIconHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theIcon)
  699. ;
  700.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  701.         Macro
  702.         _PlotIconHandle
  703.             move.w              #$061D,D0
  704.             dc.w                $ABC9
  705.         EndM
  706.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  707.         IMPORT_CFM_FUNCTION PlotIconHandle
  708.     ENDIF
  709.  
  710. ;
  711. ; pascal OSErr PlotSICNHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, Handle theSICN)
  712. ;
  713.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  714.         Macro
  715.         _PlotSICNHandle
  716.             move.w              #$061E,D0
  717.             dc.w                $ABC9
  718.         EndM
  719.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  720.         IMPORT_CFM_FUNCTION PlotSICNHandle
  721.     ENDIF
  722.  
  723. ;
  724. ; pascal OSErr PlotCIconHandle(const Rect *theRect, IconAlignmentType align, IconTransformType transform, CIconHandle theCIcon)
  725. ;
  726.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  727.         Macro
  728.         _PlotCIconHandle
  729.             move.w              #$061F,D0
  730.             dc.w                $ABC9
  731.         EndM
  732.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  733.         IMPORT_CFM_FUNCTION PlotCIconHandle
  734.     ENDIF
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747. ;   IconServices is an efficient mechanism to share icon data amongst multiple 
  748. ;   clients. It avoids duplication of data; it provides efficient caching, 
  749. ;   releasing memory when the icon data is no longer needed; it can provide
  750. ;   the appropriate icon for any filesystem object; it can provide commonly 
  751. ;   used icons (caution, note, help...); it is Appearance-savvy: the icons
  752. ;   are switched when appropriate.
  753. ;   To refer to a cached icon data, IconServices uses IconRef, a 32-bit
  754. ;   opaque value. IconRefs are reference counted. When there are no more clients 
  755. ;   for an IconRef, the bitmap memory associated with it is marked as disposeable. 
  756. ;   Two files of same type and creator with no custom icon will have the same IconRef.
  757. ;   Files with custom icons will have their own IconRef.
  758.  
  759.  
  760.  
  761.  
  762. ;   Use the special creator kSystemIconsCreator to get "standard" icons 
  763. ;   that are not associated with a file, such as the help icon.
  764.  
  765.  
  766.  
  767. kSystemIconsCreator                EQU        'macs'
  768.  
  769.  
  770. ;   Type of the predefined/generic icons. For example, the call:
  771. ;   GetIconRef(kOnSystemDisk, kSystemIconsCreator, kHelpIcon, &iconRef);
  772. ;   will retun in iconRef the IconRef for the standard help icon.
  773.  
  774.  
  775.  
  776. ;  Generic Finder icons 
  777.  
  778. kClipboardIcon                    EQU        'CLIP'
  779. kClippingUnknownTypeIcon        EQU        'clpu'
  780. kClippingPictureTypeIcon        EQU        'clpp'
  781. kClippingTextTypeIcon            EQU        'clpt'
  782. kClippingSoundTypeIcon            EQU        'clps'
  783. kDesktopIcon                    EQU        'desk'
  784. kFinderIcon                        EQU        'FNDR'
  785. kFontSuitcaseIcon                EQU        'FFIL'
  786. kFullTrashIcon                    EQU        'ftrh'
  787. kGenericApplicationIcon            EQU        'APPL'
  788. kGenericCDROMIcon                EQU        'cddr'
  789. kGenericControlPanelIcon        EQU        'APPC'
  790. kGenericControlStripModuleIcon    EQU        'sdev'
  791. kGenericComponentIcon            EQU        'thng'
  792. kGenericDeskAccessoryIcon        EQU        'APPD'
  793. kGenericDocumentIcon            EQU        'docu'
  794. kGenericEditionFileIcon            EQU        'edtf'
  795. kGenericExtensionIcon            EQU        'INIT'
  796. kGenericFileServerIcon            EQU        'srvr'
  797. kGenericFontIcon                EQU        'ffil'
  798. kGenericFontScalerIcon            EQU        'sclr'
  799. kGenericFloppyIcon                EQU        'flpy'
  800. kGenericHardDiskIcon            EQU        'hdsk'
  801. kGenericRemovableMediaIcon        EQU        'rmov'
  802. kGenericMoverObjectIcon            EQU        'movr'
  803. kGenericPCCardIcon                EQU        'pcmc'
  804. kGenericPreferencesIcon            EQU        'pref'
  805. kGenericQueryDocumentIcon        EQU        'qery'
  806. kGenericRAMDiskIcon                EQU        'ramd'
  807. kGenericSharedLibaryIcon        EQU        'shlb'
  808. kGenericStationeryIcon            EQU        'sdoc'
  809. kGenericSuitcaseIcon            EQU        'suit'
  810. kGenericWORMIcon                EQU        'worm'
  811. kInternationResourcesIcon        EQU        'ifil'
  812. kKeyboardLayoutIcon                EQU        'kfil'
  813. kSoundFileIcon                    EQU        'sfil'
  814. kSystemSuitcaseIcon                EQU        'zsys'
  815. kTrashIcon                        EQU        'trsh'
  816. kTrueTypeFontIcon                EQU        'tfil'
  817. kTrueTypeFlatFontIcon            EQU        'sfnt'
  818. kTrueTypeMultiFlatFontIcon        EQU        'ttcf'
  819. ;  Internet locations 
  820.  
  821. kInternetLocationHTTPIcon        EQU        'ilht'
  822. kInternetLocationFTPIcon        EQU        'ilft'
  823. kInternetLocationAppleShareIcon    EQU        'ilaf'
  824. kInternetLocationAppleTalkZoneIcon EQU    'ilat'
  825. kInternetLocationFileIcon        EQU        'ilfi'
  826. kInternetLocationMailIcon        EQU        'ilma'
  827. kInternetLocationNewsIcon        EQU        'ilnw'
  828. kInternetLocationGenericIcon    EQU        'ilge'
  829. ;  Folders 
  830.  
  831. kGenericFolderIcon                EQU        'fldr'
  832. kDropFolderIcon                    EQU        'dbox'
  833. kMountedFolderIcon                EQU        'mntd'
  834. kOpenFolderIcon                    EQU        'ofld'
  835. kOwnedFolderIcon                EQU        'ownd'
  836. kPrivateFolderIcon                EQU        'prvf'
  837. kSharedFolderIcon                EQU        'shfl'
  838. ;  Sharing Privileges icons 
  839.  
  840. kSharingPrivsNotApplicableIcon    EQU        'shna'
  841. kSharingPrivsReadOnlyIcon        EQU        'shro'
  842. kSharingPrivsReadWriteIcon        EQU        'shrw'
  843. kSharingPrivsUnknownIcon        EQU        'shuk'
  844. kSharingPrivsWritableIcon        EQU        'writ'
  845.  
  846. ;  Users and Groups icons 
  847.  
  848. kUserFolderIcon                    EQU        'ufld'
  849. kWorkgroupFolderIcon            EQU        'wfld'
  850. kGuestUserIcon                    EQU        'gusr'
  851. kUserIcon                        EQU        'user'
  852. kOwnerIcon                        EQU        'susr'
  853. kGroupIcon                        EQU        'grup'
  854. ;  Special folders 
  855.  
  856. kAppleExtrasFolderIcon            EQU        'aexƒ'
  857. kAppleMenuFolderIcon            EQU        'amnu'
  858. kApplicationsFolderIcon            EQU        'apps'
  859. kApplicationSupportFolderIcon    EQU        'asup'
  860. kAssistantsFolderIcon            EQU        'astƒ'
  861. kContextualMenuItemsFolderIcon    EQU        'cmnu'
  862. kControlPanelDisabledFolderIcon    EQU        'ctrD'
  863. kControlPanelFolderIcon            EQU        'ctrl'
  864. kControlStripModulesFolderIcon    EQU        'sdvƒ'
  865. kDocumentsFolderIcon            EQU        'docs'
  866. kExtensionsDisabledFolderIcon    EQU        'extD'
  867. kExtensionsFolderIcon            EQU        'extn'
  868. kFavoritesFolderIcon            EQU        'favs'
  869. kFontsFolderIcon                EQU        'font'
  870. kHelpFolderIcon                    EQU        'ƒhlp'
  871. kInternetFolderIcon                EQU        'intƒ'
  872. kInternetPlugInFolderIcon        EQU        'ƒnet'
  873. kMacOSReadMeFolderIcon            EQU        'morƒ'
  874. kPreferencesFolderIcon            EQU        'prfƒ'
  875. kPrinterDescriptionFolderIcon    EQU        'ppdf'
  876. kPrinterDriverFolderIcon        EQU        'ƒprd'
  877. kPrintMonitorFolderIcon            EQU        'prnt'
  878. kRecentApplicationsFolderIcon    EQU        'rapp'
  879. kRecentDocumentsFolderIcon        EQU        'rdoc'
  880. kRecentServersFolderIcon        EQU        'rsrv'
  881. kScriptingAdditionsFolderIcon    EQU        'ƒscr'
  882. kSharedLibrariesFolderIcon        EQU        'ƒlib'
  883. kScriptsFolderIcon                EQU        'scrƒ'
  884. kShutdownItemsDisabledFolderIcon EQU    'shdD'
  885. kShutdownItemsFolderIcon        EQU        'shdf'
  886. kSpeakableItemsFolder            EQU        'spki'
  887. kStartupItemsDisabledFolderIcon    EQU        'strD'
  888. kStartupItemsFolderIcon            EQU        'strt'
  889. kSystemExtensionDisabledFolderIcon EQU    'macD'
  890. kSystemFolderIcon                EQU        'macs'
  891. kTextEncodingsFolderIcon        EQU        'ƒtex'
  892. kAppearanceFolderIcon            EQU        'appr'
  893. kUtilitiesFolderIcon            EQU        'utiƒ'
  894. kVoicesFolderIcon                EQU        'fvoc'
  895. kColorSyncFolderIcon            EQU        'prof'
  896. kInternetSearchSitesFolderIcon    EQU        'issf'
  897. ;  Badges 
  898.  
  899. kAppleScriptBadgeIcon            EQU        'scrp'
  900. kLockedBadgeIcon                EQU        'lbdg'
  901. kMountedBadgeIcon                EQU        'mbdg'
  902. kSharedBadgeIcon                EQU        'sbdg'
  903. kAliasBadgeIcon                    EQU        'abdg'
  904. ;  Alert icons 
  905.  
  906. kAlertNoteIcon                    EQU        'note'
  907. kAlertCautionIcon                EQU        'caut'
  908. kAlertStopIcon                    EQU        'stop'
  909. ;  Networking icons 
  910.  
  911. kAppleTalkIcon                    EQU        'atlk'
  912. kAppleTalkZoneIcon                EQU        'atzn'
  913. kAFPServerIcon                    EQU        'afps'
  914. kFTPServerIcon                    EQU        'ftps'
  915. kIPFileServerIcon                EQU        'isrv'
  916. ;  Other icons 
  917.  
  918. kAppleLogoIcon                    EQU        'capl'
  919. kAppleMenuIcon                    EQU        'sapl'
  920. kBackwardArrowIcon                EQU        'baro'
  921. kFavoriteItemsIcon                EQU        'favr'
  922. kForwardArrowIcon                EQU        'faro'
  923. kGridIcon                        EQU        'grid'
  924. kHelpIcon                        EQU        'help'
  925. kKeepArrangedIcon                EQU        'arng'
  926. kLockedIcon                        EQU        'lock'
  927. kNoFilesIcon                    EQU        'nfil'
  928. kNoFolderIcon                    EQU        'nfld'
  929. kNoWriteIcon                    EQU        'nwrt'
  930. kProtectedApplicationFolderIcon    EQU        'papp'
  931. kProtectedSystemFolderIcon        EQU        'psys'
  932. kRecentItemsIcon                EQU        'rcnt'
  933. kShortcutIcon                    EQU        'shrt'
  934. kSortAscendingIcon                EQU        'asnd'
  935. kSortDescendingIcon                EQU        'dsnd'
  936. kUnlockedIcon                    EQU        'ulck'
  937. kConnectToIcon                    EQU        'cnct'
  938.  
  939. ;     Error codes range from -2580 to -2599 
  940.  
  941. invalidIconRefErr                EQU        -2580
  942. noSuchIconErr                    EQU        -2581
  943. noIconDataAvailableErr            EQU        -2582
  944.  
  945. ;     IconServicesUsageFlags 
  946. ; typedef UInt32                         IconServicesUsageFlags
  947.  
  948.  
  949. kIconServicesNormalUsageFlag    EQU        0
  950.  
  951.  
  952. ;      IconFamily 'icns' resources contain an entire IconFamily (all sizes and depths).  
  953. ;   For custom icons, icns IconFamily resources of the custom icon resource ID are fetched first before
  954. ;   the classic custom icons (individual 'ics#, ICN#, etc) are fetched.  If the fetch of the icns resource
  955. ;   succeeds then the icns is looked at exclusively for the icon data.
  956. ;   For custom icons, new icon features such as 32-bit deep icons are only fetched from the icns resource.
  957. ;   This is to avoid incompatibilities with cut & paste of new style icons with an older version of the
  958. ;   MacOS Finder.
  959. ;   DriverGestalt is called with code kdgMediaIconSuite by IconServices after calling FSM to determine a
  960. ;   driver icon for a particular device.  The result of the kdgMediaIconSuite call to DriverGestalt should
  961. ;   be a pointer an an IconFamily.  In this manner driver vendors can provide rich, detailed drive icons
  962. ;   instead of the 1-bit variety previously supported.
  963.  
  964.  
  965.  
  966. kIconFamilyType                    EQU        'icns'
  967.  
  968. IconFamilyElement        RECORD 0
  969. elementType                 ds.l    1                ; offset: $0 (0)        ;  'ICN#', 'icl8', etc...
  970. elementSize                 ds.l    1                ; offset: $4 (4)        ;  Size of this element
  971. elementData                 ds.b    1                ; offset: $8 (8) <-- really an array of length one
  972.                          ORG 10
  973. sizeof                     EQU *                    ; size:   $A (10)
  974.                         ENDR
  975. IconFamilyResource        RECORD 0
  976. resourceType             ds.l    1                ; offset: $0 (0)        ;  Always 'icns'
  977. resourceSize             ds.l    1                ; offset: $4 (4)        ;  Total size of this resource
  978. elements                 ds        IconFamilyElement ; offset: $8 (8) <-- really an array of length one
  979. sizeof                     EQU *                    ; size:   $12 (18)
  980.                         ENDR
  981. ; typedef struct IconFamilyResource *    IconFamilyPtr
  982.  
  983. ; typedef IconFamilyPtr *                IconFamilyHandle
  984.  
  985.  
  986.  
  987. ;  ==============================================================================
  988. ;   Initialization and Termination
  989. ;  ==============================================================================
  990.  
  991.  
  992.  
  993.  
  994.  
  995. ;   IconServicesInit
  996. ;   
  997. ;   Call this routine once per classic 68K application initialization.
  998. ;   This routine does not need to be called at boot time.
  999.  
  1000.  
  1001.  
  1002. ;
  1003. ; pascal OSErr IconServicesInit(CFragInitBlockPtr initBlockPtr)
  1004. ;
  1005.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1006.         Macro
  1007.         _IconServicesInit
  1008.             moveq               #21,D0
  1009.             dc.w                $AA75
  1010.         EndM
  1011.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1012.         IMPORT_CFM_FUNCTION IconServicesInit
  1013.     ENDIF
  1014.  
  1015.  
  1016.  
  1017. ;   IconServicesTerminate:
  1018. ;   
  1019. ;   Call this routine once from the termination of a classic 68K application.
  1020. ;   This routine does not need to be called at boot time.
  1021.  
  1022.  
  1023.  
  1024. ;
  1025. ; pascal void IconServicesTerminate(void )
  1026. ;
  1027.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1028.         Macro
  1029.         _IconServicesTerminate
  1030.             moveq               #22,D0
  1031.             dc.w                $AA75
  1032.         EndM
  1033.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1034.         IMPORT_CFM_FUNCTION IconServicesTerminate
  1035.     ENDIF
  1036.  
  1037.  
  1038.  
  1039.  
  1040. ;  ==============================================================================
  1041. ;   Converting data structures
  1042. ;  ==============================================================================
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048. ;   IconRefToIconFamily
  1049. ;   This routines returns a new IconFamily that contains the data corresponding
  1050. ;   to the specified IconRef
  1051.  
  1052.  
  1053.  
  1054. ;
  1055. ; pascal OSErr IconRefToIconFamily(IconRef theIconRef, IconSelectorValue whichIcons, IconFamilyHandle *iconFamily)
  1056. ;
  1057.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1058.         Macro
  1059.         _IconRefToIconFamily
  1060.             moveq               #36,D0
  1061.             dc.w                $AA75
  1062.         EndM
  1063.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1064.         IMPORT_CFM_FUNCTION IconRefToIconFamily
  1065.     ENDIF
  1066.  
  1067.  
  1068.  
  1069. ;   IconFamilyToIconSuite
  1070. ;   This routines transfers the data in an icon family into an icon suite.
  1071.  
  1072.  
  1073.  
  1074. ;
  1075. ; pascal OSErr IconFamilyToIconSuite(IconFamilyHandle iconFamily, IconSelectorValue whichIcons, IconSuiteRef *iconSuite)
  1076. ;
  1077.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1078.         Macro
  1079.         _IconFamilyToIconSuite
  1080.             moveq               #37,D0
  1081.             dc.w                $AA75
  1082.         EndM
  1083.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1084.         IMPORT_CFM_FUNCTION IconFamilyToIconSuite
  1085.     ENDIF
  1086.  
  1087.  
  1088.  
  1089. ;   IconSuiteToIconFamily
  1090. ;   This routines transfers the data in an icon suite into an icon family.
  1091.  
  1092.  
  1093.  
  1094. ;
  1095. ; pascal OSErr IconSuiteToIconFamily(IconSuiteRef iconSuite, IconSelectorValue whichIcons, IconFamilyHandle *iconFamily)
  1096. ;
  1097.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1098.         Macro
  1099.         _IconSuiteToIconFamily
  1100.             moveq               #38,D0
  1101.             dc.w                $AA75
  1102.         EndM
  1103.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1104.         IMPORT_CFM_FUNCTION IconSuiteToIconFamily
  1105.     ENDIF
  1106.  
  1107.  
  1108.  
  1109. ;   SetIconFamilyData
  1110. ;   Change the data of an icon family. The data is copied.
  1111. ;   The type can be one of the icon type, or 'PICT'
  1112. ;   The data will be compressed if needed.
  1113.  
  1114.  
  1115.  
  1116. ;
  1117. ; pascal OSErr SetIconFamilyData(IconFamilyHandle iconFamily, OSType iconType, Handle h)
  1118. ;
  1119.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1120.         Macro
  1121.         _SetIconFamilyData
  1122.             moveq               #48,D0
  1123.             dc.w                $AA75
  1124.         EndM
  1125.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1126.         IMPORT_CFM_FUNCTION SetIconFamilyData
  1127.     ENDIF
  1128.  
  1129.  
  1130.  
  1131. ;   GetIconFamilyData
  1132. ;   Return a copy of the data in the icon family.
  1133. ;   The type can be one of the icon type, or 'PICT'
  1134. ;   The data will be returned uncompressed.
  1135.  
  1136.  
  1137.  
  1138. ;
  1139. ; pascal OSErr GetIconFamilyData(IconFamilyHandle iconFamily, OSType iconType, Handle h)
  1140. ;
  1141.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1142.         Macro
  1143.         _GetIconFamilyData
  1144.             moveq               #49,D0
  1145.             dc.w                $AA75
  1146.         EndM
  1147.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1148.         IMPORT_CFM_FUNCTION GetIconFamilyData
  1149.     ENDIF
  1150.  
  1151.  
  1152.  
  1153. ;  ==============================================================================
  1154. ;   Reference counting
  1155. ;  ==============================================================================
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161. ;   GetIconRefOwners
  1162. ;   
  1163. ;   This routine returns the reference count for the IconRef, or number of owners.
  1164. ;   
  1165. ;   A valid IconRef always has at least one owner.
  1166.  
  1167.  
  1168.  
  1169. ;
  1170. ; pascal OSErr GetIconRefOwners(IconRef theIconRef, UInt16 *owners)
  1171. ;
  1172.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1173.         Macro
  1174.         _GetIconRefOwners
  1175.             moveq               #11,D0
  1176.             dc.w                $AA75
  1177.         EndM
  1178.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1179.         IMPORT_CFM_FUNCTION GetIconRefOwners
  1180.     ENDIF
  1181.  
  1182.  
  1183.  
  1184. ;   AcquireIconRef
  1185. ;   This routine increments the reference count for the IconRef
  1186.  
  1187.  
  1188.  
  1189. ;
  1190. ; pascal OSErr AcquireIconRef(IconRef theIconRef)
  1191. ;
  1192.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1193.         Macro
  1194.         _AcquireIconRef
  1195.             moveq               #39,D0
  1196.             dc.w                $AA75
  1197.         EndM
  1198.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1199.         IMPORT_CFM_FUNCTION AcquireIconRef
  1200.     ENDIF
  1201.  
  1202.  
  1203.  
  1204.  
  1205. ;   ReleaseIconRef
  1206. ;   
  1207. ;   This routine decrements the reference count for the IconRef.
  1208. ;   
  1209. ;   When the reference count reaches 0, all memory allocated for the icon
  1210. ;   is disposed. Any subsequent use of the IconRef is invalid.
  1211.  
  1212.  
  1213.  
  1214. ;
  1215. ; pascal OSErr ReleaseIconRef(IconRef theIconRef)
  1216. ;
  1217.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1218.         Macro
  1219.         _ReleaseIconRef
  1220.             moveq               #40,D0
  1221.             dc.w                $AA75
  1222.         EndM
  1223.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1224.         IMPORT_CFM_FUNCTION ReleaseIconRef
  1225.     ENDIF
  1226.  
  1227.  
  1228.  
  1229.  
  1230. ;  ==============================================================================
  1231. ;   Getting an IconRef
  1232. ;  ==============================================================================
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238. ;   GetIconRefFromFile
  1239. ;   
  1240. ;   This routine returns an icon ref for the specified file, folder or volume.
  1241. ;   The label information is provided separately, since two files with the same icon 
  1242. ;   but a different label would share the same iconRef. The label can be used in 
  1243. ;   PlotIconRef() for example.
  1244. ;   
  1245. ;   Use this routine if you have no information about the file system object. If 
  1246. ;   you have already done a GetCatInfo on the file and want to save some I/O, 
  1247. ;   call GetIconRefFromFolder() if you know it's a folder with no custom icon or 
  1248. ;   call GetIconRef() if it's a file with no custom icon.
  1249. ;   This routine increments the reference count of the returned IconRef. Call 
  1250. ;   ReleaseIconRef() when you're done with it.
  1251.  
  1252.  
  1253.  
  1254. ;
  1255. ; pascal OSErr GetIconRefFromFile(const FSSpec *theFile, IconRef *theIconRef, SInt16 *theLabel)
  1256. ;
  1257.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1258.         Macro
  1259.         _GetIconRefFromFile
  1260.             moveq               #2,D0
  1261.             dc.w                $AA75
  1262.         EndM
  1263.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1264.         IMPORT_CFM_FUNCTION GetIconRefFromFile
  1265.     ENDIF
  1266.  
  1267.  
  1268.  
  1269. ;   GetBaseIconRefFromFile
  1270. ;   
  1271. ;   This routine returns the base icon ref for a file, that is, the icon 
  1272. ;   without any badge applied to it. In most cases, you should call 
  1273. ;   GetIconRefFromFile.
  1274.  
  1275.  
  1276. ;
  1277. ; pascal OSErr GetBaseIconRefFromFile(const FSSpec *theFile, IconRef *theIconRef, SInt16 *theLabel)
  1278. ;
  1279.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1280.         Macro
  1281.         _GetBaseIconRefFromFile
  1282.             moveq               #46,D0
  1283.             dc.w                $AA75
  1284.         EndM
  1285.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1286.         IMPORT_CFM_FUNCTION GetBaseIconRefFromFile
  1287.     ENDIF
  1288.  
  1289.  
  1290.  
  1291. ;   GetIconRef
  1292. ;   
  1293. ;   This routine returns an icon ref for an icon in the desktop database or
  1294. ;   for a registered icon.
  1295. ;   The system registers a set of icon such as the help icon with the creator 
  1296. ;   code kSystemIconCreator. See above for a list of the registered system types.
  1297. ;   The vRefNum is used as a hint on where to look for the icon first. Use 
  1298. ;   kOnSystemDisk if you don't know what to pass.
  1299. ;   This routine increments the reference count of the returned IconRef. Call 
  1300. ;   ReleaseIconRef() when you're done with it.
  1301.  
  1302.  
  1303.  
  1304. ;
  1305. ; pascal OSErr GetIconRef(SInt16 vRefNum, OSType creator, OSType iconType, IconRef *theIconRef)
  1306. ;
  1307.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1308.         Macro
  1309.         _GetIconRef
  1310.             moveq               #33,D0
  1311.             dc.w                $AA75
  1312.         EndM
  1313.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1314.         IMPORT_CFM_FUNCTION GetIconRef
  1315.     ENDIF
  1316.  
  1317.  
  1318.  
  1319.  
  1320. ;   GetIconRefFromFolder
  1321. ;   
  1322. ;   This routine returns an icon ref for a folder with no custom icon.
  1323. ;   Use the more generic, but slightly slower, GetIconRefFromFile() if
  1324. ;   you don't already have the necessary info about the file.
  1325. ;   Attributes should be CInfoPBRec.dirInfo.ioFlAttrib for this folder.
  1326. ;   Access privileges should be CInfoPBRec.dirInfo.ioACUser for this folder.
  1327. ;   This routine increments the reference count of the IconRef. Call ReleaseIconRef() 
  1328. ;   when you're done with it.
  1329.  
  1330.  
  1331.  
  1332. ;
  1333. ; pascal OSErr GetIconRefFromFolder(SInt16 vRefNum, SInt32 parentFolderID, SInt32 folderID, SInt8 attributes, SInt8 accessPrivileges, IconRef *theIconRef)
  1334. ;
  1335.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1336.         Macro
  1337.         _GetIconRefFromFolder
  1338.             moveq               #34,D0
  1339.             dc.w                $AA75
  1340.         EndM
  1341.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1342.         IMPORT_CFM_FUNCTION GetIconRefFromFolder
  1343.     ENDIF
  1344.  
  1345.  
  1346.  
  1347.  
  1348. ;  ==============================================================================
  1349. ;   Adding and modifying IconRef
  1350. ;  ==============================================================================
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356. ;   RegisterIconRefFromIconFamily
  1357. ;   This routine adds a new entry to the IconRef registry. Other clients will be 
  1358. ;   able to access it using the (creator, iconType) pair specified here.
  1359. ;   Lower-case creators are reserved for the system.
  1360. ;   Consider using RegisterIconRefFromResource() if possible, since the data 
  1361. ;   registered using RegisterIconRefFromFamily() cannot be purged.
  1362. ;   The iconFamily data is copied and the caller is reponsible for disposing of it.
  1363. ;   This routine increments the reference count of the IconRef. Call ReleaseIconRef() 
  1364. ;   when you're done with it.
  1365.  
  1366.  
  1367.  
  1368. ;
  1369. ; pascal OSErr RegisterIconRefFromIconFamily(OSType creator, OSType iconType, IconFamilyHandle iconFamily, IconRef *theIconRef)
  1370. ;
  1371.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1372.         Macro
  1373.         _RegisterIconRefFromIconFamily
  1374.             moveq               #28,D0
  1375.             dc.w                $AA75
  1376.         EndM
  1377.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1378.         IMPORT_CFM_FUNCTION RegisterIconRefFromIconFamily
  1379.     ENDIF
  1380.  
  1381.  
  1382.  
  1383. ;   RegisterIconRefFromResource
  1384. ;   
  1385. ;   Registers an IconRef from a resouce file.  
  1386. ;   The icon data to be fetched is either classic icon data or an icon family.  
  1387. ;   The 'icns' icon family is searched for before the classic icon data.
  1388. ;   This routine increments the reference count of the IconRef. Call ReleaseIconRef() 
  1389. ;   when you're done with it.
  1390.  
  1391.  
  1392.  
  1393. ;
  1394. ; pascal OSErr RegisterIconRefFromResource(OSType creator, OSType iconType, const FSSpec *resourceFile, SInt16 resourceID, IconRef *theIconRef)
  1395. ;
  1396.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1397.         Macro
  1398.         _RegisterIconRefFromResource
  1399.             moveq               #35,D0
  1400.             dc.w                $AA75
  1401.         EndM
  1402.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1403.         IMPORT_CFM_FUNCTION RegisterIconRefFromResource
  1404.     ENDIF
  1405.  
  1406.  
  1407.  
  1408. ;   UnregisterIconRef
  1409. ;   
  1410. ;   Removes the specified icon from the icon cache (if there are no users of it).  
  1411. ;   If some clients are using this iconRef, then the IconRef will be removed when the 
  1412. ;   last user calls ReleaseIconRef.
  1413.  
  1414.  
  1415.  
  1416. ;
  1417. ; pascal OSErr UnregisterIconRef(OSType creator, OSType iconType)
  1418. ;
  1419.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1420.         Macro
  1421.         _UnregisterIconRef
  1422.             moveq               #8,D0
  1423.             dc.w                $AA75
  1424.         EndM
  1425.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1426.         IMPORT_CFM_FUNCTION UnregisterIconRef
  1427.     ENDIF
  1428.  
  1429.  
  1430.  
  1431.  
  1432. ;   UpdateIconRef
  1433. ;   
  1434. ;   Call this routine to force an update of the data for iconRef.
  1435. ;   
  1436. ;   For example after changing an icon in the desktop database or changing the custom 
  1437. ;   icon of a file. Note that after _adding_ a custom icon to file or folder, you 
  1438. ;   need to call GetIconRefFromFile() to get a new IconRef specific to this file. 
  1439. ;   
  1440. ;   This routine does nothing if the IconRef is a registered icon.
  1441.  
  1442.  
  1443.  
  1444. ;
  1445. ; pascal OSErr UpdateIconRef(IconRef theIconRef)
  1446. ;
  1447.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1448.         Macro
  1449.         _UpdateIconRef
  1450.             moveq               #9,D0
  1451.             dc.w                $AA75
  1452.         EndM
  1453.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1454.         IMPORT_CFM_FUNCTION UpdateIconRef
  1455.     ENDIF
  1456.  
  1457.  
  1458.  
  1459.  
  1460. ;   OverrideIconRefFromResource
  1461. ;   
  1462. ;   This routines replaces the bitmaps of the specified IconRef with the ones
  1463. ;   in the specified resource file.
  1464.  
  1465.  
  1466.  
  1467. ;
  1468. ; pascal OSErr OverrideIconRefFromResource(IconRef theIconRef, const FSSpec *resourceFile, SInt16 resourceID)
  1469. ;
  1470.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1471.         Macro
  1472.         _OverrideIconRefFromResource
  1473.             moveq               #42,D0
  1474.             dc.w                $AA75
  1475.         EndM
  1476.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1477.         IMPORT_CFM_FUNCTION OverrideIconRefFromResource
  1478.     ENDIF
  1479.  
  1480.  
  1481.  
  1482.  
  1483. ;   OverrideIconRef
  1484. ;   
  1485. ;   This routines replaces the bitmaps of the specified IconRef with the ones
  1486. ;   from the new IconRef.
  1487.  
  1488.  
  1489.  
  1490. ;
  1491. ; pascal OSErr OverrideIconRef(IconRef oldIconRef, IconRef newIconRef)
  1492. ;
  1493.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1494.         Macro
  1495.         _OverrideIconRef
  1496.             moveq               #43,D0
  1497.             dc.w                $AA75
  1498.         EndM
  1499.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1500.         IMPORT_CFM_FUNCTION OverrideIconRef
  1501.     ENDIF
  1502.  
  1503.  
  1504.  
  1505. ;   RemoveIconRefOverride
  1506. ;   This routine remove an override if one was applied to the icon and 
  1507. ;   reverts back to the original bitmap data.
  1508.  
  1509.  
  1510.  
  1511. ;
  1512. ; pascal OSErr RemoveIconRefOverride(IconRef theIconRef)
  1513. ;
  1514.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1515.         Macro
  1516.         _RemoveIconRefOverride
  1517.             moveq               #30,D0
  1518.             dc.w                $AA75
  1519.         EndM
  1520.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1521.         IMPORT_CFM_FUNCTION RemoveIconRefOverride
  1522.     ENDIF
  1523.  
  1524.  
  1525.  
  1526.  
  1527. ;  ==============================================================================
  1528. ;   Creating composite IconRef
  1529. ;  ==============================================================================
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535. ;   CompositeIconRef
  1536. ;   
  1537. ;   Superimposes an IconRef on top of another one
  1538.  
  1539.  
  1540.  
  1541. ;
  1542. ; pascal OSErr CompositeIconRef(IconRef backgroundIconRef, IconRef foregroundIconRef, IconRef *compositeIconRef)
  1543. ;
  1544.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1545.         Macro
  1546.         _CompositeIconRef
  1547.             moveq               #20,D0
  1548.             dc.w                $AA75
  1549.         EndM
  1550.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1551.         IMPORT_CFM_FUNCTION CompositeIconRef
  1552.     ENDIF
  1553.  
  1554.  
  1555.  
  1556. ;   IsIconRefComposite
  1557. ;   Indicates if a given icon ref is a composite of two other icon refs (and which ones)
  1558. ;   If it isn't a composite, backgroundIconRef and foreGroundIconRef will be 0.
  1559.  
  1560.  
  1561.  
  1562. ;
  1563. ; pascal OSErr IsIconRefComposite(IconRef compositeIconRef, IconRef *backgroundIconRef, IconRef *foregroundIconRef)
  1564. ;
  1565.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1566.         Macro
  1567.         _IsIconRefComposite
  1568.             moveq               #26,D0
  1569.             dc.w                $AA75
  1570.         EndM
  1571.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1572.         IMPORT_CFM_FUNCTION IsIconRefComposite
  1573.     ENDIF
  1574.  
  1575.  
  1576.  
  1577.  
  1578. ;  ==============================================================================
  1579. ;   Using IconRef
  1580. ;  ==============================================================================
  1581.  
  1582.  
  1583.  
  1584.  
  1585. ;   IsValidIconRef
  1586. ;   Return true if the iconRef passed in is a valid icon ref
  1587.  
  1588.  
  1589.  
  1590. ;
  1591. ; pascal Boolean IsValidIconRef(IconRef theIconRef)
  1592. ;
  1593.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1594.         Macro
  1595.         _IsValidIconRef
  1596.             moveq               #14,D0
  1597.             dc.w                $AA75
  1598.         EndM
  1599.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1600.         IMPORT_CFM_FUNCTION IsValidIconRef
  1601.     ENDIF
  1602.  
  1603.  
  1604.  
  1605. ;   PlotIconRef
  1606. ;   
  1607. ;   This routine plots the IconRef.  It mostly takes the same parameters as PlotIconSuite.
  1608. ;   Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1609.  
  1610.  
  1611.  
  1612. ;
  1613. ; pascal OSErr PlotIconRef(const Rect *theRect, IconAlignmentType align, IconTransformType transform, IconServicesUsageFlags theIconServicesUsageFlags, IconRef theIconRef)
  1614. ;
  1615.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1616.         Macro
  1617.         _PlotIconRef
  1618.             moveq               #14,D0
  1619.             dc.w                $AA75
  1620.         EndM
  1621.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1622.         IMPORT_CFM_FUNCTION PlotIconRef
  1623.     ENDIF
  1624.  
  1625.  
  1626.  
  1627. ;   PtInIconRef
  1628. ;   
  1629. ;   This routine indicates if testPt would hit the icon designated by iconRef.
  1630. ;   It mostly takes the same parameters as PtInIconSuite.
  1631. ;   Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1632.  
  1633.  
  1634.  
  1635.  
  1636. ;
  1637. ; pascal Boolean PtInIconRef(const Point *testPt, const Rect *iconRect, IconAlignmentType align, IconServicesUsageFlags theIconServicesUsageFlags, IconRef theIconRef)
  1638. ;
  1639.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1640.         Macro
  1641.         _PtInIconRef
  1642.             moveq               #15,D0
  1643.             dc.w                $AA75
  1644.         EndM
  1645.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1646.         IMPORT_CFM_FUNCTION PtInIconRef
  1647.     ENDIF
  1648.  
  1649.  
  1650.  
  1651. ;   RectInIconRef
  1652. ;   
  1653. ;   This routine indicates if testRect would intersect the icon designated by iconRef.
  1654. ;   It mostly takes the same parameters as RectInIconSuite.
  1655. ;   Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1656.  
  1657.  
  1658.  
  1659.  
  1660. ;
  1661. ; pascal Boolean RectInIconRef(const Rect *testRect, const Rect *iconRect, IconAlignmentType align, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef)
  1662. ;
  1663.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1664.         Macro
  1665.         _RectInIconRef
  1666.             moveq               #16,D0
  1667.             dc.w                $AA75
  1668.         EndM
  1669.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1670.         IMPORT_CFM_FUNCTION RectInIconRef
  1671.     ENDIF
  1672.  
  1673.  
  1674.  
  1675. ;   IconRefToRgn
  1676. ;   
  1677. ;   This routine returns a region for the icon.
  1678. ;   It mostly takes the same parameters as IconSuiteToRgn.
  1679. ;   Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1680.  
  1681.  
  1682.  
  1683. ;
  1684. ; pascal OSErr IconRefToRgn(RgnHandle theRgn, const Rect *iconRect, IconAlignmentType align, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef)
  1685. ;
  1686.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1687.         Macro
  1688.         _IconRefToRgn
  1689.             moveq               #17,D0
  1690.             dc.w                $AA75
  1691.         EndM
  1692.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1693.         IMPORT_CFM_FUNCTION IconRefToRgn
  1694.     ENDIF
  1695.  
  1696.  
  1697.  
  1698. ;   GetIconSizesFromIconRef
  1699. ;   
  1700. ;   This routine returns an IconSelectorValue indicating the depths and sizes of 
  1701. ;   icon data which are actually available.  It takes an IconSelectorValue 
  1702. ;   indicating which sizes/depths the caller is interested and returns an 
  1703. ;   IconSelectorValue indicating which sizes/depths exist.
  1704. ;   
  1705. ;   Caution:
  1706. ;   
  1707. ;   This is potentially an extremely expensive call as IconServices may be forced 
  1708. ;   to attempt fetching the data for the IconRef's sizes/depths which may result 
  1709. ;   in hitting the local disk or even the network to obtain the data to determine 
  1710. ;   which sizes/depths actually exist.
  1711. ;   Pass kIconServicesNormalUsageFlag as a default value for IconServicesUsageFlags.
  1712.  
  1713.  
  1714.  
  1715. ;
  1716. ; pascal OSErr GetIconSizesFromIconRef(IconSelectorValue iconSelectorInput, IconSelectorValue *iconSelectorOutputPtr, IconServicesUsageFlags iconServicesUsageFlags, IconRef theIconRef)
  1717. ;
  1718.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1719.         Macro
  1720.         _GetIconSizesFromIconRef
  1721.             moveq               #18,D0
  1722.             dc.w                $AA75
  1723.         EndM
  1724.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1725.         IMPORT_CFM_FUNCTION GetIconSizesFromIconRef
  1726.     ENDIF
  1727.  
  1728.  
  1729.  
  1730.  
  1731. ;  ==============================================================================
  1732. ;   Flushing IconRef data
  1733. ;  ==============================================================================
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739. ;   FlushIconRefs
  1740. ;   
  1741. ;   Making this call will dispose of all the data for the specified icons if 
  1742. ;   the data can be reacquired, for example if the data is provided from a resource.
  1743. ;   '****' is a wildcard for all types or all creators.
  1744.  
  1745.  
  1746.  
  1747. ;
  1748. ; pascal OSErr FlushIconRefs(OSType creator, OSType iconType)
  1749. ;
  1750.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1751.         Macro
  1752.         _FlushIconRefs
  1753.             moveq               #41,D0
  1754.             dc.w                $AA75
  1755.         EndM
  1756.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1757.         IMPORT_CFM_FUNCTION FlushIconRefs
  1758.     ENDIF
  1759.  
  1760.  
  1761.  
  1762. ;   FlushIconRefsByVolume
  1763. ;   
  1764. ;   This routine disposes of the data for the icons related to the indicated volume
  1765. ;   if this data can be reacquired, for example if the data is provided from a 
  1766. ;   resource.
  1767.  
  1768.  
  1769.  
  1770. ;
  1771. ; pascal OSErr FlushIconRefsByVolume(SInt16 vRefNum)
  1772. ;
  1773.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1774.         Macro
  1775.         _FlushIconRefsByVolume
  1776.             moveq               #24,D0
  1777.             dc.w                $AA75
  1778.         EndM
  1779.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1780.         IMPORT_CFM_FUNCTION FlushIconRefsByVolume
  1781.     ENDIF
  1782.  
  1783.  
  1784.  
  1785.  
  1786. ;  ==============================================================================
  1787. ;   Controling custom icons
  1788. ;  ==============================================================================
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794. ;   SetCustomIconsEnabled
  1795. ;   
  1796. ;   Enable or disable custom icons on the specified volume.
  1797.  
  1798.  
  1799.  
  1800. ;
  1801. ; pascal OSErr SetCustomIconsEnabled(SInt16 vRefNum, Boolean enableCustomIcons)
  1802. ;
  1803.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1804.         Macro
  1805.         _SetCustomIconsEnabled
  1806.             moveq               #31,D0
  1807.             dc.w                $AA75
  1808.         EndM
  1809.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1810.         IMPORT_CFM_FUNCTION SetCustomIconsEnabled
  1811.     ENDIF
  1812.  
  1813.  
  1814.  
  1815. ;   GetCustomIconsEnabled
  1816. ;   
  1817. ;   Return true if custom icons are enabled on the specified volume, false otherwise.
  1818.  
  1819.  
  1820.  
  1821. ;
  1822. ; pascal OSErr GetCustomIconsEnabled(SInt16 vRefNum, Boolean *customIconsEnabled)
  1823. ;
  1824.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1825.         Macro
  1826.         _GetCustomIconsEnabled
  1827.             moveq               #32,D0
  1828.             dc.w                $AA75
  1829.         EndM
  1830.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1831.         IMPORT_CFM_FUNCTION GetCustomIconsEnabled
  1832.     ENDIF
  1833.  
  1834.  
  1835.  
  1836. ;   SetCustomIconFamily
  1837. ;   Sets the custom icon of a file or folder.
  1838. ;   AliasIcon should be true to indicate you want to specify the 
  1839. ;   appearance that the alias file should have. You can further
  1840. ;   override the appearance of the alias by specifying a custom 
  1841. ;   icon.
  1842.  
  1843.  
  1844. ;
  1845. ; pascal OSErr SetCustomIconFamily(const FSSpec *theFile, Boolean aliasIcon, IconRef customIcon)
  1846. ;
  1847.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  1848.         Macro
  1849.         _SetCustomIconFamily
  1850.             moveq               #47,D0
  1851.             dc.w                $AA75
  1852.         EndM
  1853.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1854.         IMPORT_CFM_FUNCTION SetCustomIconFamily
  1855.     ENDIF
  1856.  
  1857.  
  1858.     ENDIF ; __ICONS__ 
  1859.  
  1860.